package pers.cz.javacvdemo.common;

/**
 * BaseErrorEnum description
 *
 * @author 
 * @version 1.0.0
 * @date 2023-06-28 16:28:23
 */
public enum BaseErrorEnum implements Error {

	SUCCESS(0, "success"),
	REQUEST_ERROR(10000, "请求异常"),
	PARAMETER_MISS(10001, "缺少必要参数"),
	PARAMETER_INVALID(10002, "参数不合法"),
	AUTHENTICATION_ERROR(10400, "认证失败"),
	UN_AUTHENTICATION(10401, "未认证"),
	TOKEN_EXPIRED(10402, "Token过期"),
	ACCOUNT_DISABLED(10403, "账户被禁用"),
	ACCOUNT_NOT_FUND(10404, "账户不存在"),
	PASSWORD_NOT_VALID(10405, "密码不正确"),
	REGISTER_EMAIL_EXIST(10406, "邮箱已存在"),
	EMAIL_IS_USED(10407, "邮箱已被其他账号绑定"),
	ACCESS_DENIED(10503,"无权限访问"),
	// 自定义提示，客户端直接拿msg 提示
	CUSTOMIZE_TIP(90000,"Error."),
	SERVER_UNAVAILABLE(99998, "服务暂不可用"),
	SERVER_ERROR(99999, "处理异常");

	private int code;

	private String msg;

	BaseErrorEnum(int code, String msg) {
		this.code = code;
		this.msg = msg;
	}

	@Override
	public int getCode() {
		return code;
	}

	@Override
	public String getMsg() {
		return msg;
	}
}
